#ifndef TESTS_HPP_
# define TESTS_HPP_

/*! \file Tests.hpp
 * Contains various macro used by the UnitTest classes
 */

# include "TestRunner.hpp"
# include "TestFailureException.hpp"

/*! Used to send parameters to TestRunner::AddTestCase function */
#define UTESTS_MAKE_CASE_DATA(functionPtr) \
  __FILE__, __LINE__, (#functionPtr), functionPtr

/*! Used to get a case function's valid prototype */
# define UTESTS_FUNCTION_PROTOTYPE(fName) void fName (void)

/*! Used to start a test case's function */
# define UTESTS_START_TEST(fName)	UTESTS_FUNCTION_PROTOTYPE(fName) {

/*! Used to end a test case's function */
# define UTESTS_END_TEST		}

/*! Using this macro will make the test fail if condition is FALSE */
# define UTESTS_FAIL_UNLESS(condition, errorMessage)		\
    if (!(condition))						\
      throw (unit_test::TestFailureException(__LINE__, errorMessage));

/*! Using this macro will make the test fail if condition is TRUE */
# define UTESTS_FAIL_IF(condition, errorMessage)		\
    if (condition)						\
      throw (unit_test::TestFailureException(__LINE__, errorMessage));

/*! Using this macro will make the test fail */
# define UTESTS_FAIL(errorMessage)				\
    throw (unit_test::TestFailureException(__LINE__, errorMessage));

/*! \namespace unit_test
 * Basic unit testing suite
 */
namespace unit_test {
}

#endif /* !TESTS_HPP_ */
